<!--问题类型管理-->
<template>
	<div>
		<!--查询部分-->
		<el-row>
			<el-col :span="1">
				<p class="queryLabel">问卷名称：</p>
			</el-col>
			<el-col :span="3" style="padding-left: 10px;">
				<el-input v-model="queryData.numberName" size="small" placeholder="请输入问卷"></el-input>
			</el-col>
			<el-col :span="1" style="padding-left: 10px;">
				<el-button size="small" type="primary" @click="queryButton">查 询</el-button>
			</el-col>
			<el-col :span="1" style="margin-left: 200px;">
				<el-button size="small" type="primary" @click="addButton">新 增</el-button>
			</el-col>
			<el-col :span="1" style="padding-left: 10px;">
				<el-button size="small" type="primary" @click="editButton">编 辑</el-button>
			</el-col>
			<el-col :span="1" style="padding-left: 10px;">
				<el-button size="small" type="primary" @click="startButton">启 用</el-button>
			</el-col>
			<el-col :span="1" style="padding-left: 10px;">
				<el-button size="small" type="primary" @click="stopButton">停 用</el-button>
			</el-col>
		</el-row>

		<!--表格部分-->
		<el-row>
			<el-col :span="24">
				<el-table :data="tableData.dataList" stripe border @selection-change="handleSelectionChange">
					<el-table-column type="selection" width="50">
					</el-table-column>
					<el-table-column prop="quesitonCode" label="问券编号" width="220"></el-table-column>
					<el-table-column prop="quesitonName" label="问券名称" width="220"></el-table-column>
					<el-table-column prop="quesitonType" label="问券类型" width="220"></el-table-column>
					<el-table-column prop="dispOrder" label="显示顺序" width="220"></el-table-column>
					<el-table-column label="状态" width="220" :formatter="statusCov"></el-table-column>
				</el-table>
				<el-pagination small @size-change="handleSizeChange" @current-change="handleCurrentChange" @current-page="CurentPage" :page-sizes="page.pageSizes" :page-size="page.pageSize" layout="total,prev, pager, next" :total="tableData.total"></el-pagination>
			</el-col>
		</el-row>

		<el-dialog title="生成问卷" v-model="addDialogShow" size="large">
			<el-row>
				<el-col :span="24">
					<el-row>
						<el-form :model="editData" :rules="rules" ref="editData" label-width="100px" class="demo-ruleForm">

							<el-row>
								<el-col :span="8">
									<el-form-item label="问卷编号" prop="quesitonCode">
										<el-input v-model="editData.quesitonCode"></el-input>
									</el-form-item>
								</el-col>
								<el-col :span="8">
									<el-form-item label="问卷名称" prop="quesitonName">
										<el-input v-model="editData.quesitonName"></el-input>
									</el-form-item>
								</el-col>
							</el-row>
							<el-row>
								<el-col :span="8">
									<el-form-item label="问卷类型" prop="quesitonType">
										<el-input v-model="editData.quesitonType"></el-input>
									</el-form-item>
								</el-col>
								<el-col :span="8">
									<el-form-item label="显示顺序" prop="dispOrder">
										<el-input v-model="editData.dispOrder" type="Number"></el-input>
									</el-form-item>
								</el-col>
								<el-col :span="8">
									<el-button type="primary" size="small" @click="generatingQuestion('editData')">生成问卷</el-button>
								</el-col>
							</el-row>

						</el-form>
					</el-row>

					<el-row>
						<el-col :span="3" v-if='leftTreeShow'>
							<el-table :data="questionLeftTree.dataList" border @selection-change="" @cell-click="queryItemButton" highlight-current-row>
								<!--ref="singleTable"-->
								<el-table-column prop="groupName" label="分类名称" width="220"></el-table-column>
							</el-table>
						</el-col>

						<el-col :span="10" v-if='leftTableShow' style="margin-left: 20px;">
							<el-table :data="questionTableData.dataList" stripe border @cell-click="questionQueryItemButton" highlight-current-row>
								<!--<el-table-column type="selection" width="50" fixed>
								</el-table-column>-->
								<el-table-column prop="itemName" label="项目名称" width="220"></el-table-column>
								<el-table-column prop="dispOrder" label="优先级" width="220"></el-table-column>
								<el-table-column prop="score" label="分数" width="220"></el-table-column>

							</el-table>
							<el-pagination small @size-change="questionhandleSizeChange" @current-change="questionhandleCurrentChange" @current-page="questionCurentPage" :page-sizes="questionPage.pageSizes" :page-size="questionPage.pageSize" layout="total,prev, pager, next" :total="questionTableData.total"></el-pagination>

						</el-col>
						<el-col :span="9" v-if='leftTableShow' style="margin-left: 20px;">
							<el-table :data="questionItemTableData.dataList" stripe border highlight-current-row>
								<!--<el-table-column type="selection" width="50">
								</el-table-column>-->
								<el-table-column prop="areaCode" label="编号" width="120"></el-table-column>
								<el-table-column prop="areaName" label="名称" width="220"></el-table-column>
								<!--<el-table-column prop="score" label="分数" width="250"></el-table-column>-->
								<el-table-column label="分数" width="190">
									<template scope="scope">
										<el-row>
											<el-col :span="12">
												<el-input v-model="scope.row.score" @change="scoreBlur(scope.$index, scope.row)" style="width: 80px;"></el-input>
											</el-col>
											<el-col :span="10" style="float: right;">
												<el-button :id="scope.row.areaId" style="display: none;" type="primary" size="small" @click="handleEdit(scope.$index, scope.row)">修改</el-button>
											</el-col>
										</el-row>
									</template>
								</el-table-column>
							</el-table>

						</el-col>
					</el-row>
					<el-row :gutter="24">

						<el-col :span="18" style="margin-left: 200px; ">
							<!--v-if="leftTableItemShow" -->

						</el-col>
					</el-row>

				</el-col>

			</el-row>
			<el-row>
				<!--v-if="leftTableShow"-->
				<el-col :span="2" style="float: right;">
					<el-button type="primary" size="small" style="margin-right: 100px;float: left;" @click="questionCansel">取 消</el-button>
				</el-col>

				<el-col :span="2" style="float: right;">
					<el-button type="primary" size="small" style="margin-right: 60px;float: left;" @click="questionSubmit">提 交</el-button>
				</el-col>

				<el-col :span="2" style="float: right;">
					<el-button type="primary" size="small" style="margin-right: 20px;float: left;" @click="sckan">预 览</el-button>
				</el-col>
			</el-row>

		</el-dialog>

		<!--问题树-->
		<el-dialog v-model='questionTreeShow'>
			<el-row>
				<el-col :span="24">
					<el-tree v-loading="loadingshow" element-loading-text="正在提交请稍后.." :data="resTreeData" ref="resTree" :highlight-current=true :props="resProps" accordion :auto-expand-parent=false :default-checked-keys="checkedResKey" show-checkbox node-key="id"></el-tree>
					<el-button type="primary" size="small" style="float: right;" @click="checkChange">提 交</el-button>
				</el-col>
			</el-row>

		</el-dialog>

		<el-dialog title="编辑" v-model="editDialogShow" size="tiny">

			<el-form :model="editData" :rules="rules" ref="editData" label-width="100px" class="demo-ruleForm">
				<el-form-item label="等级编号" prop="groupCode">
					<el-input v-model="editData.groupCode"></el-input>
				</el-form-item>

				<el-form-item label="等级名称" prop="groupName">
					<el-input v-model="editData.groupName"></el-input>
				</el-form-item>

				<el-form-item label="显示顺序" prop="dispOrder">
					<el-input v-model="editData.dispOrder"></el-input>
				</el-form-item>
			</el-form>

			<el-row>
				<el-col :span="12">
					<el-button type="primary" size="small" style="margin-left: 100px;" @click="editSubmit('editData')">提 交</el-button>
				</el-col>
				<el-col :span="12">
					<el-button type="primary" size="small" style="margin-left: 70px;" @click="editCansel">取 消</el-button>
				</el-col>
			</el-row>
		</el-dialog>

		<el-dialog title="调研问卷" v-model="sckanDialogShow" size="large">
			<div v-for="(item,index) in group">
				<!--分类循环-->
				<fieldset>
					<!--分类外边框-->
					<legend>
						<font style="font-size: larger;">{{item.groupName}}</font>
					</legend>
					<!--外边框标识-->

					<el-row v-for="(itemItem,inIndex) in group[index].item">
						<!--问题项循环-->
						<el-col :span="4">
							<font style="font-size: larger;">{{itemItem.itemName+" : "}}</font>
						</el-col>

						<el-col :span="18">
							<el-row v-if="itemItem.itemType == 'ddx'">
								<el-radio-group v-model="itemItem.id" v-for="itemArea in group[index].item[inIndex].area">
									<el-radio :label="itemArea.areaName" style="margin-left: 10px;">{{itemArea.areaName}}</el-radio>
								</el-radio-group>
							</el-row>
							<el-row v-if="itemItem.itemType == 'dx'">
								<el-checkbox-group v-model="itemItem.id">
									<el-checkbox :label="itemArea.areaName" style="margin-left: 10px;" v-for="itemArea in group[index].item[inIndex].area">
										{{itemArea.areaName}}
									</el-checkbox>
								</el-checkbox-group>
							</el-row>
							<el-row v-if="itemItem.itemType == 'wb'">
								<el-input type="textarea" size="small" v-model="itemItem.id"></el-input>
							</el-row>

						</el-col>

					</el-row>

				</fieldset>
				<div style="margin-top: 50px;"></div>
			</div>
		</el-dialog>

	</div>

</template>

<script>
	export default {
		data: function() {
			return {
				group: [],

				ddxCheck: [],
				dxCheck: "",
				questionData: {
					dataList: [],
					questionId: "",
				},
				questionDataArea: {
					dataList: [],
				},
				canselType: "",
				loadingshow: false,

				questionSaveSuccess: false,
				questionTreeShow: false,
				leftTreeShow: false,
				leftTableShow: false,
				leftTableItemShow: false,

				sckanDialogShow: false,
				btn: null,
				// 左侧树 接收数据
				questionLeftTree: {
					dataList: [],
				},
				// 左侧树 post参数
				leftTreeData: {},
				// 问题项表格post参数
				questionTableQueray: {
					questionId: "",
					groupId: "",

				},
				// 问题项表格
				questionTableData: {
					total: 0,
					dataList: []
				},
				// 评分值post参数
				questionItemTableQueray: {
					questionId: "",
					groupId: "",
					itemId: "",
				},
				// 评分值表格
				questionItemTableData: {
					total: 0,
					dataList: []
				},
				questionCurentPage: 1,
				questionPage: this.page,
				groupId: "",
				itemId: "",
				itemGroupId: "",
				questionId: "",
				score: "",
				scoreButton: false,
				rules: {
					quesitonCode: [{
							required: true,
							message: '请输入问卷编号',
							trigger: 'blur'
						}

					],
					quesitonName: [{
							required: true,
							message: '请输入问卷名称',
							trigger: 'blur'
						}

					],
					quesitonType: [{
							required: true,
							message: '请输入问卷类型',
							trigger: 'blur'
						}

					],
					dispOrder: [{
							required: true,
							message: '请输入显示顺序',
							trigger: 'blur'
						}

					],

				},
				//树型数据配置
				resProps: {
					children: 'child',
					label: 'tName'
				},
				checkedResKey: [],

				resTreeData: [],
				// 新增dialog显示
				addDialogShow: false,
				//  编辑dialog 显示
				editDialogShow: false,
				// 查询集合
				queryData: {
					numberName: "",
				},
				CurentPage: 1,
				page: this.page,
				// 查询数据
				tableData: {
					total: 0,
					dataList: [],
				},
				// 修改数据
				editData: {
					quesitonCode: "",
					quesitonName: "",
					quesitonType: "",
					dispOrder: "",
					companyId: "",
					id: "",
					status: "",

				},
				// 修改数据初始化
				emptyEditData: {
					quesitonCode: "",
					quesitonName: "",
					quesitonType: "",
					dispOrder: "",
					companyId: "",
					id: "",
					status: "",

				},
				// 选择数据
				multipleSelection: "",

			}
		},
		methods: {
			dxgb: function(id, value) {
				alert(id + "__" + value);
			},
			// 问卷取消
			questionCansel: function() {

				this.$data.addDialogShow = false;
				this.queryButton();

			},
			// 问卷提交
			questionSubmit: function() {
				if(this.$data.questionId == "") {
					this.$message.error("提交失败");
				} else {
					this.$data.addDialogShow = false;
					this.$data.questionTreeShow = false,
						this.$data.leftTreeShow = false,
						this.$data.leftTableShow = false,
						this.$data.leftTableItemShow = false,
						this.$data.questionSaveSuccess = false;
					this.queryButton();

					this.$message("提交成功！");
				}
			},
			scoreBlur: function(index, row) {
				debugger;
				if(this.$data.btn != null) {
					this.$data.btn.style.display = "none";
				}

				debugger;
				this.$data.btn = document.getElementById(row.areaId);
				this.$data.btn.style.display = "block";
			},
			// 修改
			handleEdit: function(index, row) {
				debugger;
				this.$http.get(this.API_ROOT + '/crm/question/group/item/area/saveScore', {
					params: {
						id: row.id,
						score: row.score,
						itemId: row.itemId,
						questionId: row.quesitonId
					}
				}).then(resp => {
					if(resp.data.success) {
						debugger;
						this.$message("修改成功");
						this.$data.btn.style.display = "none";
						this.$data.groupId = row.groupId;
						this.$data.questionId = row.quesitonId;
						this.questionTableQuery();
					} else {
						this.$message.error(resp.data.msg);
					}
				}, resp => {});
			},
			// 浏览
			sckan: function() {
				//alert("预览");
				this.$http.get(this.API_ROOT + '/crm/question/questionPreview', {
					params: {
						questionId: this.$data.questionId
					}
				}).then(resp => {
					if(resp.data.success) {
						debugger;
						this.$message("修改成功");
						this.$data.group = resp.data.dataList;
						this.$data.sckanDialogShow = true;
					} else {
						this.$message.error(resp.data.msg);
					}
				}, resp => {});
			},
			// 左侧数点击
			queryItemButton: function(row) {
				debugger;
				//var r = row;
				this.$data.questionTableData.dataList = []; // 问题项置空
				this.$data.questionItemTableData.dataList = []; // 评分项置空
				this.$data.groupId = row.groupId;
				//alert("左侧数点击");
				this.questionTableQuery();
				this.$data.leftTableItemShow = false;
			},
			// 左侧数据表格点击
			questionQueryItemButton: function(row) {
				debugger;
				//var r = row;
				this.$data.itemId = row.itemId;
				this.$data.itemGroupId = row.groupId;
				this.questionItemTableQuery();
				this.$data.leftTableItemShow = true;
			},
			// 问题树提交
			checkChange: function() {

				this.$data.loadingshow = true;

				var Nodes = this.$refs.resTree.getCheckedNodes();
				var dataList = [];

				var data = {
					dataList: Nodes,
					questionId: this.$data.questionId
				}

				this.treePost(data);
			},
			// 问题树提交HTTP请求
			treePost: function(data) {
				this.$http({
					method: 'POST',
					url: this.API_ROOT + '/crm/question/group/save',
					body: data,
					params: {
						//Nodes: Nodes
					}
				}).then(function(resp) {
					this.$message(resp.data.msg);
					if(resp.data.success) {

						this.$data.questionTreeShow = false;

						this.$data.questionSaveSuccess = true; // 保存成功
						this.$data.questionTableData.dataList = []; // 问题项置空
						this.$data.questionItemTableData.dataList = []; // 评分项置空
						//this.$data.resTreeShow = false;
						this.getLeftTree(); // 提交后查询左侧树
						this.$data.leftTreeShow = true;
						this.$data.loadingshow = false;
					}
				}, function(error) {
					// error
				})
			},

			// 问题项提交HTTP请求
			AreaPost: function(data) {
				debugger;
				this.$http({
					method: 'POST',
					url: this.API_ROOT + '/crm/question/group/item/area/save',
					body: data,
					params: {
						//Nodes: Nodes
					}
				}).then(function(resp) {
					this.$message(resp.data.msg);
					if(resp.data.success) {
						debugger;

					}
				}, function(error) {
					// error
				})
			},
			// 左侧树
			getLeftTree: function() {
				debugger;
				this.$http.post(this.API_ROOT + '/crm/question/group/leftTree', this.$data.leftTreeData, {
					params: {
						questionId: this.$data.questionId
					}
				}).then(resp => {
					if(resp.data.success) {
						this.$data.questionLeftTree.dataList = resp.data.dataList;
						this.$data.leftTableShow = true;
					} else {
						this.$message.error(resp.data.msg);
					}
				}, resp => {});
			},
			//问题项表格
			questionTableQuery: function() {
				debugger;
				this.$data.questionTableQueray.groupId = this.$data.groupId;
				this.$data.questionTableQueray.questionId = this.$data.questionId;

				this.$http.post(this.API_ROOT + '/crm/question/group/item/page', this.$data.questionTableQueray, {
					params: {
						start: this.$data.questionCurentPage,
						limit: this.$data.questionPage.pageSize,
					}
				}).then(resp => {
					if(resp.data.success) {
						resp.data.total = parseInt(resp.data.total);
						this.$data.questionTableData.dataList = resp.data.dataList;
						this.$data.questionTableData.total = resp.data.total;
					} else {
						this.$message.error(resp.data.msg);
					}
				}, resp => {});
			},
			// 评分项表格
			questionItemTableQuery: function() {

				this.$data.questionItemTableQueray.itemId = this.$data.itemId;
				this.$data.questionItemTableQueray.groupId = this.$data.itemGroupId;
				this.$data.questionItemTableQueray.questionId = this.$data.questionId;

				this.$http.post(this.API_ROOT + '/crm/question/group/item/area/page', this.$data.questionItemTableQueray, {
					params: {
						//start: this.$data.questionCurentPage,
						//limit: this.$data.questionPage.pageSize,
					}
				}).then(resp => {
					if(resp.data.success) {
						this.$data.questionItemTableData.dataList = resp.data.dataList;

					} else {
						this.$message.error(resp.data.msg);
					}
				}, resp => {});
			},
			/**
			 * 获取资源树
			 * ***/
			queryResTree: function() {
				//获取资源树
				this.$http.get(this.API_ROOT + '/crm/question/questionTree', {}).then((response) => {
					this.$data.resTreeData = response.data.dataList;
				}, (response) => {});
			},
			//选择框
			handleSelectionChange: function(val) {
				debugger;
				this.$data.multipleSelection = val;
			},
			// 生成问卷
			generatingQuestion: function(formName) {
				//alert("生成问卷");
				debugger;
				this.$refs[formName].validate((valid) => {
					if(valid) {

						this.$http.post(this.API_ROOT + '/crm/question/save', this.$data.editData, {
							params: {}
						}).then(resp => {
							if(resp.data.success) {
								debugger;
								this.$message("生成问卷成功！");
								this.$data.questionId = resp.data.data.id;
								this.$data.editData.id = resp.data.data.id;
								this.$data.questionTreeShow = true;
								//this.queryButton();
							} else {
								this.$message.error(resp.data.msg);
								//this.$data.questionTreeShow = true;
							}
						}, resp => {});

					} else {
						this.$message.error("表单填写不全！");
						return false;
					}
				});
			},
			// 查 询 
			queryButton: function() {
				//alert("查询");
				debugger;
				this.$http.get(this.API_ROOT + '/crm/question/page', {
					params: {
						questionName: this.$data.queryData.numberName,
						start: this.CurentPage,
						limit: this.$data.page.pageSize,
					}
				}).then(resp => {
					if(resp.data.success) {
						resp.data.total = parseInt(resp.data.total);
						this.$data.tableData.dataList = resp.data.dataList;
						this.$data.tableData.total = resp.data.total;
					} else {
						this.$message.error(resp.data.msg);
					}
				}, resp => {});
			},
			// 添加按钮
			addButton: function() {
				//this.$data.canselType = "新增";
				//alert("新增");
				this.$data.editData = Object.assign(this.$data.editData, this.$data.emptyEditData);
				this.$data.questionId = "";

				this.$data.leftTreeShow = false,
					this.$data.leftTableShow = false,
					this.$data.leftTableItemShow = false,
					this.$data.questionSaveSuccess = false;
				this.$data.addDialogShow = true;
			},

			/**编辑按钮**/
			editButton: function() {

				debugger;
				if(this.$data.multipleSelection.length != 1) {
					this.$message.error("请选择一条数据!");
					return;
				}
				if(this.$data.multipleSelection[0].status == '1') {
					this.$message.error("启用状态禁止修改!");
					return;
				}
				this.$data.questionTableData.dataList = []; // 问题项置空
				this.$data.questionItemTableData.dataList = []; // 评分项置空

				this.$data.editData = Object.assign(this.$data.editData, this.$data.emptyEditData);

				this.$http.get(this.API_ROOT + '/crm/question/info', {
					params: {
						id: this.$data.multipleSelection[0].id,
					}
				}).then(resp => {
					if(resp.data.success) {
						debugger;
						this.$data.editData.quesitonName = resp.data.dataList.quesitonName;
						this.$data.editData.quesitonType = resp.data.dataList.quesitonType;
						this.$data.editData.quesitonCode = resp.data.dataList.quesitonCode;
						this.$data.editData.dispOrder = resp.data.dataList.dispOrder.toString();
						this.$data.editData.id = resp.data.dataList.id;
						this.$data.questionId = resp.data.dataList.id;

						this.getLeftTree();

						this.$data.addDialogShow = true;
						//this.$data.questionTreeShow=true,
						this.$data.leftTreeShow = true,
							this.$data.leftTableShow = true,
							this.$data.leftTableItemShow = true,
							this.$data.questionSaveSuccess = true;
						//this.$data.canselType = "编辑"
					} else {
						//this.$message.error(resp.data.msg);
					}
				}, resp => {});
			},

			// 启用
			startButton: function() {
				//alert("启用");
				if(this.$data.multipleSelection.length != 1) {
					this.$message.error("请选择一条数据");
					return;
				}
				this.$http.get(this.API_ROOT + '/crm/question/start', {
					params: {
						id: this.$data.multipleSelection[0].id,
					}
				}).then(resp => {
					if(resp.data.success) {
						this.$message(resp.data.msg);
						this.queryButton(); // 刷新
						this.$data.multipleSelection = []; // 选择置空
					} else {
						this.$message.error(resp.data.msg);
						this.queryButton(); // 刷新
						this.$data.multipleSelection = []; // 选择置空
					}
				}, resp => {});
			},
			// 停用
			stopButton: function() {
				//alert("停用");
				if(this.$data.multipleSelection.length != 1) {
					this.$message.error("请选择一条数据");
					return;
				}
				this.$http.get(this.API_ROOT + '/crm/question/stop', {
					params: {
						id: this.$data.multipleSelection[0].id,
					}
				}).then(resp => {
					if(resp.data.success) {
						this.$message(resp.data.msg);
						this.queryButton(); // 刷新
						this.$data.multipleSelection = []; // 选择置空
					} else {
						this.$message.error(resp.data.msg);
						this.queryButton(); // 刷新
						this.$data.multipleSelection = []; // 选择置空
					}
				}, resp => {});
			},
			/**【添加】提交**/
			addSubmit: function(formName) {
				//alert("新增提交");

				this.$refs[formName].validate((valid) => {
					if(valid) {

						this.$http.post(this.API_ROOT + '/crm/question/save', this.$data.editData, {
							params: {}
						}).then(resp => {
							if(resp.data.success) {
								resp.data.total = parseInt(resp.data.total);
								this.$data.tableData.dataList = resp.data.dataList;
								this.$data.tableData.total = resp.data.total;
								this.$data.addDialogShow = false;
								this.$message("保存成功！");
								this.queryButton();
							} else {
								this.$message.error(resp.data.msg);
							}
						}, resp => {});

					} else {
						this.$message.error("表单填写不全！");
						return false;
					}
				});

			},
			/**【添加】取消**/
			addCansel: function() {
				//alert("新增取消");
				this.$data.addDialogShow = false;
			},

			/** 【编辑】提交 **/
			editSubmit: function(formName) {

				this.$refs[formName].validate((valid) => {
					if(valid) {

						//alert("新增提交");
						this.$data.editData.id = this.$data.multipleSelection[0].id;
						this.$http.post(this.API_ROOT + '/crm/base/survery/group/save', this.$data.editData, {
							params: {}
						}).then(resp => {
							if(resp.data.success) {
								resp.data.total = parseInt(resp.data.total);
								this.$data.tableData.dataList = resp.data.dataList;
								this.$data.tableData.total = resp.data.total;
								this.$data.editDialogShow = false;
								this.$message("保存成功！");
								this.queryButton();
							} else {
								this.$message.error(resp.data.msg);
							}
						}, resp => {});

					} else {
						this.$message.error("表单填写不全！");
						return false;
					}
				});
			},
			/**【编辑】 取消**/
			editCansel: function() {
				//alert("新增取消");
				this.$data.editDialogShow = false;
			},

			//列表分页大小切换
			handleSizeChange: function() {},
			//列表当前页切换
			handleCurrentChange: function(currentPage) {
				this.$data.CurentPage = currentPage;
				this.queryButton();
			},
			/**问题项列表**/
			//列表分页大小切换
			questionhandleSizeChange: function() {},
			//列表当前页切换
			questionhandleCurrentChange: function(currentPage) {
				this.$data.questionCurentPage = currentPage;
				this.questionTableQuery();
			},

			// 状态转换
			statusCov: function(row) {
				switch(row.status) {
					case '0':
						return "未启用";
						break;
					case '1':
						return "已启用";
						break;
					default:
						return "状态未知";
						break;

				}
			},
		},
		created: function() {
			this.queryButton();
			this.queryResTree();
			///this.getLeftTree(); // 左侧树
		}
	}
</script>

<style>

</style>